﻿<link href="~/Content/LoginPartial.css" rel="stylesheet" />
@if (Request.IsAuthenticated)
{
    <text>
        Hello, @Html.ActionLink(User.Identity.Name, "Manage", "Account", null, new {@class = "username", title = "Manage"})!
        @using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new {id = "logoutForm"}))
        {
            @Html.AntiForgeryToken()
            <a href="javascript:document.getElementById('logoutForm').submit()">Log out</a>
        }
    </text>
}
else
{
    <nav>
        <ul>
            <li id="login">
                <a id="login-trigger" href="#">Log in <span>▼</span>
                </a>
                <div id="login-content">

                    <fieldset id="actions">
                        @using (Html.BeginForm("ExternalLogin", "Account", new {ViewBag.ReturnUrl}))
                        {
                            @Html.AntiForgeryToken()
                            <fieldset id="socialLoginList">
                                <legend>Log in using Google</legend>
                                <p>
                                    <button type="submit" name="provider" value="Google" title="Log in using your Google account">Google</button>
                                </p>
                            </fieldset>
                        }
                    </fieldset>

                </div>
            </li>
        </ul>
    </nav>
}
<script type="text/javascript"> //alert("from login partial");
    //$(document).ready(function () {
    //alert("are u kidding me");
    $("#login-content").hide();
    $('#login-trigger').click(function () {
        $(this).next('#login-content').slideToggle();
        $(this).toggleClass('active');

        if ($(this).hasClass('active')) $(this).find('span').html('&#x25B2;');
        else $(this).find('span').html('&#x25BC;');
    });

    //});



</script>